package  
{
	import net.flashpunk.graphics.Text;
	import net.flashpunk.Entity;
	
	public class streakText extends Entity
	{
		[Embed(source = 'fonts/streak.ttf', embedAsCFF = "false", fontFamily = 'StreakFont')]
		private const STREAK_FONT:Class;
		private var theText:Text;
		
		public var count:int;
		
		public function streakText() 
		{
			Text.font = "StreakFont";
			theText = new Text("");
			theText.resizable = true;
			graphic = theText;
			theText.align = "center";
			layer = -1;
		}
		
		public override function update():void {
			if (fracasWorld.streak > 0) {
				
				theText.size = 10 + Math.floor(fracasWorld.streak);
				if (theText.size > 20) theText.size = 20; 
				theText.text = "x " + fracasWorld.streak.toString();
			}
			if (count == 0) theText.text = "";
			
			if (count > 0) {
				theText.alpha = (count / 30.0);
				count--;
			}
			
		}
		
	}

}